package com.anXin.user.controller;


import com.anXin.model.common.dtos.ResponseResult;
import com.anXin.model.user.pojos.Memo;
import com.anXin.model.user.pojos.Oldman;
import com.anXin.user.service.MemoService;
import com.anXin.user.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("/memo")
public class MemoController {

    @Resource
    private MemoService memoService;


    @PostMapping("/add")
    private ResponseResult add(@RequestBody Memo memo) {
        return memoService.add(memo);
    }

    @GetMapping("/list/{id}")
    private ResponseResult getList(@PathVariable("id") Long id){
        return memoService.getList(id);
    }

    @DeleteMapping("/delete/{id}")
    private ResponseResult delete(@PathVariable("id") Long id){
        return memoService.delete(id);
    }


    @PutMapping("/update")
    private ResponseResult updateMemo(@RequestBody Memo memo){
        return memoService.updateMemo(memo);
    }
    @GetMapping("/Info/{id}")
    public ResponseResult Info(@PathVariable("id")  Long id) {
        return memoService.Info(id);
    }

}